package com.wujieming.controller;

import javax.servlet.http.HttpServletRequest;

import net.sf.json.JSONObject;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/test")
public class TestController {  
	int i = 0;
	@RequestMapping("jsp")
	public String  jsp(Model model, HttpServletRequest request) throws Exception  { 
	    return "/test";
    }
	@RequestMapping("json")
	@ResponseBody
	public JSONObject  json(Model model, HttpServletRequest request) throws Exception  { 
		JSONObject jsonObject = new JSONObject();
		jsonObject.put("test", "this is test");
	    return jsonObject;
    }
	
	@RequestMapping("websocket")
	@ResponseBody
	public void  websocket(Model model, HttpServletRequest request) throws Exception  { 
		i++;
    }
}
